﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SocialFront.Entities;
using SocialFront.Providers.Blog;
using SocialFront.Providers.Relationship;

namespace SocialFront.Web.usercontrols.Blog
{
    public partial class MemberHomeBlogList : System.Web.UI.UserControl
    {
        public string MemberBlogUrl { get; set; }

        protected void Page_Load(object sender, EventArgs e)
        {
            IList<Member> members = RelationshipProvider.Provider.GetMemberRelatedToCurrentNode();
            List<Entities.Blog> blogs = BlogProvider.Provider.GetBlogsByMember(members[0].Id, 1, 4);
            blogList.DataSource = blogs;
            blogList.DataBind();

            MemberBlogUrl = BlogProvider.Provider.GetMemberBlogUrl(members[0].Id);
        }
    }
}